package com.newland.starpos.partner.dao;

import java.util.ArrayList;
import java.util.List;

import org.springframework.stereotype.Repository;

import com.newland.starpos.base.HibernateGenericDao;
import com.newland.starpos.entity.User;

@Repository
public class UserDao extends HibernateGenericDao<User, Long>{
	
	/**
	 * 查询同手机号的用户存不存在
	 * @param phoneNumber
	 * @return
	 */
	public int queryUserPhoneExist(String phoneNumber) {
		List<Object> param = new ArrayList<>();
		StringBuilder querySql = new StringBuilder("SELECT count(1) FROM t_user where telephone = ?");
		param.add(phoneNumber);
		return Integer.parseInt(this.findUniqueBySql(querySql.toString(), param).toString());
	}

}
